{extend name="layout/layout" /}

{block name="content"}
<blockquote class="layui-elem-quote quoteBox" style="height: 38px;line-height: 38px;">
    <div class="layui-input-inline">
        <h2 >线上商订单售后详情</h2>
    </div>
    <div class="layui-input-inline" style="float: right;">
        <a  href="javascript:history.back(-1)"  class="layui-btn layui-btn-normal "><i class="layui-icon">&#xe65a;</i>返回</a>
    </div>
</blockquote>
<div style="padding: 20px; background-color: #F2F2F2;">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md6">
            <div class="layui-card">
                <div class="layui-card-header">售后编号: {$info.out_refund_no}</div>
                <div class="layui-card-header">订单ID: {$info.order_id}</div>
                <div class="layui-card-header">订单金额: ¥{$info.old_total}</div>
                <div class="layui-card-header">退款金额: ¥{$info.refund_fee}</div>

            </div>
        </div>
        <div class="layui-col-md6">
            <div class="layui-card">
                <div class="layui-card-header">售后时间: {$info.create_date}</div>
                <div class="layui-card-header">售后人: {$info.member_phone}</div>
                <div class="layui-card-header">原订单状态:
                    {if $info.ostatus == 2}待发货{elseif $info.ostatus == 4}已经收货{elseif $info.ostatus == 6}未提货{elseif $info.ostatus == 7}已提货{/if}
                </div>
                <div class="layui-card-header" style="font-size: 18px;">支付方式: {if $info.pay_method == 1}微信支付{elseif $info.pay_method == 2}支付宝{else/}余额支付{/if}</div>
            </div>
        </div>
    </div>
</div>
<table id="dataTable01" lay-filter="dataTable"></table>
<blockquote class="layui-elem-quote quoteBox" style="height: 38px;line-height: 38px;margin-top: 20px;">
    <div class="layui-input-inline" style="float: right;">
        {if $info.status == 1}
        <button class="layui-btn layui-btn-normal refuse_aftersale">拒绝售后</button>
        <button class="layui-btn layui-btn-normal agree_aftersale">同意售后</button>
        {elseif $info.status == 3}
        <div class="layui-card-header" style="float: left;padding: 0"><h3>已经拒绝售后</h3></div>
        <input type="hidden" id="help_refuse_input" value="{$info.content}">
        <div class="layui-card-header" id="help_refuse" style="float: left;cursor:Pointer">
            <i class="layui-icon layui-icon-help" style="font-size: 16px;"></i>
        </div>
        {elseif $info.status == 4}
        <div class="layui-card-header"><h3>已同意，等待用户退货</h3></div>
        {elseif $info.status == 2 || $info.status == 6}
        <div class="layui-card-header" style="float: left"><h3>退款金额：¥{$info.refund_fee}</h3></div>
        <div class="layui-card-header" style="float: left">
            <button class="layui-btn layui-btn-normal confirm_refund">确认退款</button>
        </div>
        {elseif $info.status == 7}
        <div class="layui-card-header" style="float: left"><h3>{$info.end_date}</h3></div>
        <div class="layui-card-header" style="float: left"><h3>售后成功，已退款</h3></div>
        {elseif $info.status == 5}
        <button class="layui-btn layui-btn-normal view_logistics">查看物流</button>
        <button class="layui-btn layui-btn-normal confirm_receipt">确认收货</button>
        {/if}

    </div>
    </div>

</blockquote>
<div class="layui-form-item" id="refuse" style="display: none;margin-top: 10%">
    <div class="layui-inline" style="width: 84%;">
        <label class="layui-form-label">拒绝原因</label>
        <div class="layui-input-block">
                 <textarea class="layui-textarea" id="content" maxlength="50" name="content" placeholder="请填写拒绝售后原因"></textarea>
        </div>
    </div>
    <div class="layui-inline" style="width: 84%;">
        <div class="layui-input-block">
            <span style="color: #757575">（拒绝之前请确保与用户沟通过）</span>
        </div>
    </div>

</div>
<input type="hidden" id="aftersale_id" value="{$info.id}" >
<input type="hidden" class="detail_url" value="{:url('admin/aftersale/detail')}?id={$info.id}">
<input type="hidden" class="search_cangku_url" value="{:url('admin/saleol/search_cangku')}">
<input type="hidden" class="peisong_url" value="{:url('admin/saleol/peisong')}">

{/block}

{block name="pagescript"}
<script>
    var DELETE_URL = "{:url('admin/product/delete')}";
</script>
<script src="__STATIC__/admin/pages/js/aftersale.js" type="text/javascript"></script>
{/block}